<?php

function smarty_modifier_paginate($s, $paj)
{
	$page = $paj['page'];
	$total = $paj['total'];
	$per_page = $paj['per_page'];
	
    $pij = "";
    for($i = 0; $i < $total; $i+=$per_page) {
    	$p = floor($i/12)+1;
    	if($p == $page) {
    		$pij .= "<b>$p</b>&nbsp;";
    		continue;
    	}
    	$pij .= sprintf('<a href="?page=%s">%s</a>&nbsp;%s', $p, $p, "\n");
    }
    
    return $pij;
}

?>
